package top.yesz.home.controller;

import top.yesz.home.pojo.User;
import top.yesz.home.service.IGoService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/test")
public class TestController {
    @Resource
    private IGoService goService;

    @PostMapping("/commit")
    public String commitTransmit(@RequestBody User user) {
        return aspectCommit(user);
    }

    public String aspectCommit(User user) {
        List<Object> list = goService.aspectCommit(user);
        String s = (String) list.get(0);
        return s;
    }
}
